#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void f(){
  
  /*va contenir les adresses des appelants*/
  void *buffer[10];
  /*va contenir les traduction en symboles*/
  char **strings;
  
  int nptrs = backtrace(buffer, 10);
  printf("backtrace() returned %d addresses\n", nptrs);
  
  
  strings = backtrace_symbols(buffer, nptrs);
  
  for (int j = 0; j < nptrs; j++)
    printf("buffer[%d]=%p, sym = %s\n", j,buffer[j],strings[j]);
  
   free(strings);
   
}

void g(){
  f();
}

int main(void){
  g();
}
